﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;


public class BSearcherController : MonoBehaviour
{
    public Scene scene;
    public enum Scene
    {
        MovieDaydreamer, MovieAgan, MovieEndless, TemplateAgan, SceneWork, SceneSport, SceneMusic, Action10, OldScenePhone,
        Else
    }

    [Header("Available Scenes")]
    public StringStringDictionary MovieDaydreamer = new StringStringDictionary
    {
        {"typely", "type" },
    };

    public StringStringDictionary MovieAgan = new StringStringDictionary
    {
        { "putly", "put_cap"},
    };

    public StringStringDictionary MovieEndless = new StringStringDictionary
    {
        {"washly", "wash_dish_2"},
        {"washinly", "wash_dish_2"},
        {"pullinly", "pull_heavy"},
        {"pullly", "pull_heavy"},
        { "typely", "type" },
        { "playly", "type" },
        { "playinly", "type"},
    };

    public StringStringDictionary TemplateAgan = new StringStringDictionary
    {
        { "seely","see_around" },
        { "lookly", "see_around" },
        { "findly", "see_around"},
    };

    public StringStringDictionary SceneWork = new StringStringDictionary
    {
        {"sawinly", "saw_wood" },
        {"sawly", "saw_wood" },
        {"hammerinly", "hammer_nail" },
        {"hammerly", "hammer_nail" },
        {"drawinly", "draw_diagram" },
        {"drawly", "draw_diagram" },
    };

    public StringStringDictionary SceneSport = new StringStringDictionary
    {
        {"kickly", "kick_143_24"},
        {"kickinly", "kick_143_24"},
        {"punchly", "punching_bag"},
        {"punchinly", "punching_bag"},
        {"hookly", "hook"},
        {"hookinly", "hook"},

        {"warmly", "arm_stretching"},
        {"warminly", "arm_stretching"},
        {"drinkinly", "drink_13_07"},
        {"drinkly", "drink_13_07"},
    };

    public StringStringDictionary SceneMusic = new StringStringDictionary
    {
        {"wearly", "wear_headphone" },
        {"wearinly", "wear_headphone" },
        {"singly","sing"},
        {"singinly", "sing" },
        {"pushly", "push_button" },
        {"pushinly", "push_button" },
    };

    public StringStringDictionary Action10 = new StringStringDictionary
    {
        // 10 action
        {"lookinly", "search_files"},
        {"dancinly", "hip_hop_dance"},
        {"throwinly", "football_124_01"},
        {"playinly", "gaming"},
        // {"playinly", "golf_124_07"},
        {"seeinly", "flashlight_77_05"},
        {"choppinly", "chopwood_79_01"},
        {"hanginly", "hangpicture_79_20"},
        {"shavinly", "makeup_79_83"},
        {"gaminly", "gaming"},
    };

    public StringStringDictionary OldScenePhone = new StringStringDictionary
    {
        {"callly","talk_phone"},
        {"madly","defeated_idle"},
        {"sadly","defeated" },
        {"writely","write_on_the_blackboard"},
        {"angrily","sitting_angry" },
        {"bitterly","banging_fist"},
        {"unbelievably","sit_disbiefly"},
    };

    public StringStringDictionary Else = new StringStringDictionary // 所有其他的场景调试所涉及的动作在这里添加
    {
        {"playly", "type"},
        {"playinly", "type"},
        {"typely", "type"},
    };

    // Use this for initialization
    void Start()
    {
        switch (scene)
        {
            case Scene.MovieDaydreamer:
                BVHSearcher.keyMaps = MovieDaydreamer;
                break;
            case Scene.MovieAgan:
                BVHSearcher.keyMaps = MovieAgan;
                break;
            case Scene.MovieEndless:
                BVHSearcher.keyMaps = MovieEndless;
                break;
            case Scene.SceneSport:
                BVHSearcher.keyMaps = SceneSport;
                break;
            case Scene.SceneWork:
                BVHSearcher.keyMaps = SceneWork;
                break;
            case Scene.TemplateAgan:
                BVHSearcher.keyMaps = TemplateAgan;
                break;
            case Scene.SceneMusic:
                BVHSearcher.keyMaps = SceneMusic;
                break;
            case Scene.Action10:
                BVHSearcher.keyMaps = Action10;
                break;
            case Scene.OldScenePhone:
                BVHSearcher.keyMaps = OldScenePhone;
                break;
            case Scene.Else:
                BVHSearcher.keyMaps = Else;
                break;
        }
    }

    // Update is called once per frame
    void Update()
    {
        switch (scene)
        {
            case Scene.MovieDaydreamer:
                BVHSearcher.keyMaps = MovieDaydreamer;
                break;
            case Scene.MovieAgan:
                BVHSearcher.keyMaps = MovieAgan;
                break;
            case Scene.MovieEndless:
                BVHSearcher.keyMaps = MovieEndless;
                break;
            case Scene.SceneSport:
                BVHSearcher.keyMaps = SceneSport;
                break;
            case Scene.SceneWork:
                BVHSearcher.keyMaps = SceneWork;
                break;
            case Scene.TemplateAgan:
                BVHSearcher.keyMaps = TemplateAgan;
                break;
            case Scene.SceneMusic:
                BVHSearcher.keyMaps = SceneMusic;
                break;
            case Scene.Action10:
                BVHSearcher.keyMaps = Action10;
                break;
            case Scene.OldScenePhone:
                BVHSearcher.keyMaps = OldScenePhone;
                break;
            case Scene.Else:
                BVHSearcher.keyMaps = Else;
                break;
        }
    }
}
